package com.ruoyi.project.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.JsonObject;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.base.Field;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import javax.validation.constraints.Digits;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;

@Data
@ApiModel("阶段字典配置表")
@TableName(value = "project",autoResultMap = true)
public class Project extends Field {

    private static final long serialVersionUID = 1L;

    /** 项目编号 */
    @TableId
    private String projectNo;

    /** 项目名称 */
    @Excel(name = "项目名称")
    private String projectName;

    /** 归属公司 */
    @Excel(name = "归属公司编码")
    private String companyNo;

    /** 归属公司名称 */
    @Excel(name = "归属公司名称")
    private String companyName;

    /** 归属公司名称 */
    @Excel(name = "归属公司名称")
    private String companyType;





    /** 发起人所在部门id */
    private Long createDept;

    /** 发起人所在部门id */
    private Long createUserId;

    /** 发起人名称 */
    private String createUserName;

    /** 发起人所在部门 */
    @Excel(name = "发起人所在部门名称")
    private String createDeptName;

    /** 项目金额 */
    @Excel(name = "项目金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal projectAmount;

    /** 项目类型 */
    @Excel(name = "项目类型")
    private String projectType;

    /** 项目类型名称 */
    @Excel(name = "项目类型名称")
    private String projectTypeName;


    /** 项目配合单位 */
    @Excel(name = "项目配合单位")
    private String projectUnit;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预计开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date planDate;  /** 预计开始日期 */


    /** 预计验收日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预计验收日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date acceptTime;


    /** 预收款日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预计验收日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date paymentDate;


    /** 客户地址 */
    @Excel(name = "客户地址")
    private String customerAddress;

    /** 客户名称 */
    @Excel(name = "客户名称")
    private String customerName;


//    @TableField(value = "housekeeper_project",typeHandler = JacksonTypeHandler.class)
//    @JsonProperty
//    private List<String> housekeeperProject;

    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String housekeeperProject;

    /** 管家婆项目 */
    @Excel(name = "管家婆项目")
    private String housekeeperName;

    /** 当前阶段id*/
    @TableField(exist = false)
    private String phaseId;

    /** 当前阶段 */
    @Excel(name = "当前阶段名称")
    @TableField(exist = false)
    private String phaseName;

    /** 备注 */
    @Excel(name = "备注")
    private String remark;

    /** 备注 */
    @Excel(name = "环节留言")
    @TableField(exist = false)
    private String phaseRemark;

    
    /**  */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startDate;

    /** 立项日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "立项日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date approvalDate;



    /** 合同金额 */
    @Excel(name = "合同金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal contractAmount;

    /** 结算金额 */
    @Excel(name = "结算金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal settlementAmount;


    /** 留言 */
    @Excel(name = "留言")
    private String message;



    @TableField(exist = false)
    private List<ProjectParticipan> participanList;


    /** 部门id */
    private Long deptId;

    /** 用户id */
    private Long userId;

    //阶段确认人 点击下一步的
    @TableField(exist = false)
    private String joinPeople;

    //当前阶段的操作人
    @TableField(exist = false)
    private String currentPeople;

    //用户保存的配置
    @TableField(exist = false)
    private List<String> tableConfig;

    @TableField(exist = false)
    private Integer overDays;

    //该项目的绩效是否已经发放完成1否2是
    private Integer finish;


    //发放比例
    @TableField(exist = false)
    private BigDecimal percentage;

    //已发放
    @TableField(exist = false)
    private BigDecimal already;

    //未发放
    @TableField(exist = false)
    private BigDecimal wait;

    //总金额
    @TableField(exist = false)
    private BigDecimal personTotal;


    //绩效确认日期
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date confirmDate;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date completeDate;

    @TableField(exist = false)
    private BigDecimal warranty;

    //质保开始日期
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
    private Date warrantyStartDate;

    //质保到期日期
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "", width = 30, dateFormat = "yyyy-MM-dd")
    private Date warrantyEndDate;

    //是否有保险单 1 否 2 是
    private String policy;

    //保险单附件地址
    private String policyFile;

    //是否是销售项目 1否2是  默认1
    private String saleProject;

    //销售项目是否归档  1否2是
    private String saleCom;


}